Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-7780834 BDI Donation Stage Defaults to "Opportunity Stage When Fully Paid" value #6810

Merged

Conversation

mldyang
Copy link
Contributor

@mldyang mldyang commented Jan 13, 2022

Fixed the issue where BDI Donation Stage ignores Opportunity Stage When Fully Paid value. Now, if "Opportunity Stage When Fully Paid" setting has a value, the default Donation Stage will be set to that value.
(Note that DI's Donation Stage, if different than Opportunity Stage When Fully Paid value, will take precedence)
For reference, here is a table summarizing expected results https://salesforce.quip.com/hW4eA11a5zFd

  • BDI Donation Stage will be defaulted to Opportunity Stage When Fully Paid value if one is available.

Critical Changes

Changes

NPSP Data Importer Enhancements

  • We improved how NPSP Data Importer handles Opportunity Stages. When you've not set an Opportunity Stage on the NPSP Data Import record, NPSP Data Importer uses the value in NPSP Settings for Opportunity Stage When Fully Paid.

Issues Closed

Community Ideas Delivered

  • Idea delivered: Elevate - Ability to control stage for Closed/Won Opportunity

Features Intended for Future Release

Features for Elevate Customers

New Metadata

Deleted Metadata

@mldyang mldyang self-assigned this Jan 13, 2022
@mldyang mldyang changed the title W-7780834 BDI Donation Stage Default W-7780834 BDI Donation Stage Defaults to "Opportunity Stage When Fully Paid" value Jan 13, 2022
@mldyang mldyang marked this pull request as ready for review January 13, 2022 23:35
Copy link
Contributor

@callen-sfdo callen-sfdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few small things.

} else {
defaultClosedWonStage = '';
// if no field is specified in contact setting, then query for the active isWon value and use that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// if no field is specified in contact setting, then query for the active isWon value and use that
// if no stage name is specified in contact setting, then query for the active isWon value and use that

* in Contact Setting Payments_Auto_Close_Stage_Name__c
*/
@IsTest
static void donationShouldUseDIDonationStage() {
Copy link
Contributor

@callen-sfdo callen-sfdo Jan 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two tests are good, but I would consider combining them into one unit test with two data import records to reduce the total number of DML statements and trigger run time (just concerned about total test execution time). Also you could consider just running these synchronously with BDI_DataImport_API.processDataImportRecords instead of batch execution which should save a little more processing time but not effect the outcome. If these didn't involve DML I would agree its cleaner to have them separate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented, thanks for the suggestions!

WHERE IsActive = TRUE
AND IsWon = TRUE
];
if (stages.size() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could replace these 5 lines of code with the following:
defaultClosedWonStage = stages.size()>0 ? stages[0].MasterLabel : '';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Implemented, thanks!

Copy link
Contributor

@grivero grivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@callen-sfdo callen-sfdo merged commit 0e36876 into feature/238 Feb 7, 2022
@callen-sfdo callen-sfdo deleted the feature/238__myang-W-7780834-bdi-closed-stage branch February 7, 2022 23:28
@salesforce-org-metaci salesforce-org-metaci bot mentioned this pull request Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants